<template>
    <!-- <Title>snow-title</Title> -->

  <div>
    userid: {{ $route.params.id }}
    <p>userName: {{ $route.query.name }}</p>
    <NuxtLink to="/user/1">点我跳转</NuxtLink>
    <a href="/user/2">user-id-2</a>
    <NuxtLink :to="{ path: `/user/${3}` }">user-id-3</NuxtLink>
    <p @click="toUser">点击执行方法</p>
    <img src="~/assets/images/fontlogo.png" alt="">
  </div>
</template>

<script setup>
// 如果该页面不想用layout
// definePageMeta({
//     layout: false
// })

// 如果该页面想用指定的layout
// definePageMeta({
//     layout: 'layout-snow'
// })

// 动态设置layout
// const router = useRoute()
// function enableLayout () {
//     router.meta.layout = "layout-snow"
// }

useHead({
    title: 'snow-title-2',
    meta: [
        { name: 'description', content: 'snow-desc'},
        { name: 'keywords', content: 'snow-kw'}
    ]
})
const route = useRoute();
console.log(route.params, route.query);

function toUser() {
  navigateTo({
    path: "/user/4",
    query: {
      name: "snow",
    },
  });
}
</script>

<style scoped></style>
